<?php

require_once ROOT . 'server/classes/arquitetura/entity/AbstractEntity.class.php';

class Login extends AbstractEntity {

    private $empresa;
    private $email;
    private $senha;
    private $code;

    /**
     * Default Constructor.
     */
    public function __construct() {
    }

    public function setEmpresa($empresa) {
        $this->empresa = $empresa;
    }

    public function getEmpresa() {
        return $this->empresa;
    }

    public function setEmail($email) {
        $this->email = $email;
    }

    public function getEmail() {
        return $this->email;
    }

    public function setSenha($senha) {
        $this->senha = $senha;
    }

    public function getSenha() {
        return $this->senha;
    }

    public function setCode($code) {
        $this->code = $code;
    }

    public function getCode() {
        return $this->code;
    }

    public function __toString() {
        return $this->getEmail();
    }

    public function equals($obj) {
        if (empty($obj)) {
            return false;
        }

        if ($this === $obj) {
            return true;
        } else if ($this == $obj) {
            return true;
        } else if ($this->getEmail() == $obj->getEmail()) {
            return true;
        }
        return false;
    }

    public function cloneMe() {
        $newLogin = new Login();
        $newLogin->setEmpresa($this->getEmpresa());
        $newLogin->setEmail($this->getEmail());
        $newLogin->setSenha($this->getSenha());
        $newLogin->setCode($this->getCode());
        return $newLogin;
    }

}

?>
